//package com.demo.config.datasource.multiple;
//
//import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
//import org.apache.ibatis.session.SqlSessionFactory;
//import org.mybatis.spring.annotation.MapperScan;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
//
//import javax.sql.DataSource;
//
///**
// * @author wangfengchen
// * mybatis 配置数据源
// *
// */
//@MapperScan(basePackages = "com.demo.mapper2", sqlSessionFactoryRef = "sqlSessionFactoryTest2")
//@Configuration
//public class DataSource2MybatisConfig {
//
//
//  @Bean
//  public SqlSessionFactory sqlSessionFactoryTest2(@Qualifier("test2DataSource") DataSource dataSource) throws Exception {
//    MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
//    bean.setDataSource(dataSource);
//    bean.setMapperLocations(new PathMatchingResourcePatternResolver().getResources("classpath:mapper/*.xml"));
//    return bean.getObject();
//  }
//
//
//}
